ποΈGitΠ―ΡΠ°ποΈ
Simple LXMF bot for environmental readings over Reticulum
σ° Files β’ σ±£ Work (0) β’ σ° Commits (14) β’ σ°¬ Branches (1) β’ σ°Ό Tags (0) β’ σ° Thanks (1) β’ ο Stats
>weather-lxmf
Simple LXMF bot for environmental readings over Reticulum.
Requirements
β’ Raspberry Pi (or similar)
β’ BME280 sensor (I2C) or DHT22 sensor (GPIO)
β’ Python 3
Installation
pip install rns lxmf smbus2 RPi.bme280
Usage
python weather.py
For DHT22 sensor, enable the kernel driver by adding to T383838/boot/config.txt:
dtoverlay=dht11,gpiopin=4
Then reboot and run:
SENSOR_TYPE=dht22 python weather.py
On first run, the bot will create an identity and announce itself on the
network. The LXMF address will be printed to the console.
Commands
Send any of these from Sideband or another LXMF client:
Weather Commands
β’ T383838/weather, T383838/wx, T383838/sensors - get all sensor readings
β’ T383838/temp, T383838/temperature - get temperature only
β’ T383838/humidity, T383838/humid - get humidity only
β’ T383838/pressure, T383838/press - get pressure only (BME280 only)
Utility Commands
β’ T383838/ping - check if the bot is responsive (replies with "pong")
β’ T383838/help - show list of available commands
Configuration
Configuration via environment variables:
βββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β Variable β Default β Description β
βββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββ€
β T383838SENSOR_TYPE β T383838bme280 β Sensor type: T383838bme280 or T383838dht22 β
β T383838I2C_BUS β T3838381 β I2C bus number (BME280) β
β T383838I2C_ADDRESS β T3838380x76 β I2C address in hex (BME280) β
β T383838DHT_DEVICE β T383838/sys/devices/platform/dht11@4/iio:devβ¦ β Sysfs path to DHT device β
β T383838DHT_RETRIES β T3838385 β Number of read retries for DHT22 β
β T383838IDENTITY_PATH β T383838~/.config/rns/weather_identity β Identity key location β
β T383838STORAGE_PATH β T383838~/.config/rns/weather_storage β LXMF message storage β
β T383838DISPLAY_NAME β T383838Weather Station β Bot name on network β
β T383838COMMANDS β T383838/weather,/wx,/sensors,/bme280 β Commands for all readings β
β T383838ANNOUNCE_INTERVAL β T3838383600 β Seconds between announces β
β T383838PROM_FILE β β Prometheus textfile path (optional) β
β T383838PROM_INTERVAL β T38383860 β Prometheus export interval β
βββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββ
Example:
SENSORTYPE=dht22 DISPLAYNAME="My Weather Bot" python weather.py
License
MIT
Served by rngit 1.4.2 - Generated in 0.12s